package xin.pms.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import xin.pms.model.Menu;

import java.util.List;

/**
 * <pre>
 * Menu Repository
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @version 1.0
 * @since 2018/7/28 15:37
 */
@Repository
public interface MenuRepository  extends PagingAndSortingRepository<Menu, String>, JpaSpecificationExecutor<Menu> {

    List<Menu> findByParentIdOrderByPriority(String menuPid);

    List<Menu> findByPriorityGreaterThan(Integer priority);

    List<Menu> findByParentId(String parentId);
}
